<div style="border:0px red dashed;height:48px;">
<div class="avatar">
  <%=image_tag"person_avatar.gif"%>
  <span id='indicator_<%=people.id%>' style="display:none"><%=image_tag"indicator.gif"%></span>
</div>

<p><%=people.name%></p>
<%if not @project.nil?%>
  <%=people.project_role(@project)%>
<%else%>
  <%if people.account_owner?%>
    <%="Account Owner".t%>
  <%else%>
    <%=people.role.t if people.role%>
  <%end%>
<%end%>

<%if @cur_user.have_power?(@project)%>
  <%=link_to image_tag("arrow_bellow.gif",:border=>0,:alt=>"Change Role",:id=>"change_role_" + people.id.to_s,:style=>"display:on"), "#", :onclick=>"Element.show('roles_#{people.id}')" if not people.account_owner? %>
     <%end%>
  <div class='roles'  style="display:none" id='roles_<%=people.id%>'>
   <span style="float:right;margin-top:-3px;margin-right:-3px;">
    <%=link_to image_tag("close.gif",:border=>0,:id=>"close_role_" + people.id.to_s,:style=>"display:on"),
       "#",:onclick=>"Element.hide('roles_#{people.id}')"
    %> 
   </span>
    <%if @project.nil?%> 
      <%ROLES.each do |r|%>
      <div style="padding:2px;">
        <%=link_to_remote (r == people.role ? "<b>" + r.t + "</b>" : r.t),:loading=>"Element.show('indicator_#{people.id}')",:url=>{:action=>'change_global_role',:id=>people.id,:role=>r}%>
      </div>
      <%end%>
    <%else%>
      <div style="padding:2px;">
        <%=link_to_remote "Project Manager".t,{:loading=>"Element.show('indicator_#{people.id}')",:url=>{:action=>'change_role',:id=>people.id,:project_id=>@project.id,:role=>"Project Manager"}},{:onclick=>"Element.hide('roles_#{people.id}')"}%>
      </div>
     <%@project.roles.each do |r|%>
      <div style="padding:2px;">
        <%if people.roles.include?(r)%>
	<b>
	<%end%>
        <%=link_to_remote r.identifier,{:loading=>"Element.show('indicator_#{people.id}')",:url=>{:action=>'change_role',:id=>people.id,:role_id=>r.id,:project_id=>(@project.nil? ? "" : @project.id)}},{:onclick=>"Element.hide('roles_#{people.id}')"}%>
        <%if people.roles.include?(r)%>
	</b>
	<%end%>
      </div>
     <%end%>
    <%end%>
  </div>
<%if @cur_user.have_power?(people)%>
<br/>
  <%if @project%>
    <%=link_to "Edit".t,edit_project_person_path(@project,people),:class=>'admin'%> 
  <%else%>
    <%=link_to "Edit".t,edit_person_path(people),:class=>'admin'%> 
  <%end%>
 <%if @cur_user.have_power? and (not people.account_owner?)%>
 |  
 <%=link_to_remote image_tag("trash.gif",:border=>0),{:url=>{:action=>'destroy',:uid=>people.id,:project_id=>params[:project_id]},:confirm=>"Are you sure?".t,:method=>'delete',:loading=>"new Effect.Highlight('td_#{people.id}',{duration:15});Element.show('indicator_#{people.id}')"},:class=>'admin',:title=>"this action will remove this people from this project and the company".t%>
<%end%>
<%end%>
</div>
 <%if @project and @cur_user.have_power? and (not people.account_owner?)%>
 <%=image_tag"icon/remove_people.gif"%>
 <%=link_to_remote "Remove from this project".t,{:url=>{:action=>'remove',:uid=>people.id,:project_id=>@project.id},:confirm=>"Mr./Ms. %s will remove from all the projects he/she participated,\n Are you sure?"/people.name,:loading=>"new Effect.Highlight('td_#{people.id}',{duration:15});Element.show('indicator_#{people.id}')"},:class=>'admin',:title=>"Remove this people out this project but not delete, you can add back in the future.".t%> 
<br/>
<%end%>

<%if people.email.to_s.size>0%>
<%=image_tag"icon/email.gif"%>
<%=link_to people.email,"mailto:" + people.email,:class=>'email'%>
<%end%>

<%if people.msn.to_s.size>0%>
<br/>
<%=image_tag"icon/msn.gif"%>
<%=link_to people.msn,"mailto:" + people.msn,:class=>'email'%>
<%end%>

<%if people.gtalk.to_s.size>0%>
<br/>
<%=image_tag"icon/gtalk.gif"%>
<%=link_to people.gtalk,"mailto:" + people.gtalk,:class=>'email'%>
<%end%>

<%if people.qq.to_s.size>0%>
<br/>
<%=image_tag"icon/qq.gif"%>
<%=people.qq%>
<%end%>

<%if people.tel_mobile.to_s.size>0%>
<br/>
M:<%=people.tel_mobile%>
<%end%>

<%if people.tel_work.to_s.size>0%>
<br/>
O:<%=people.tel_work%>
 <%if people.tel_work_ext.to_s.size>0%>
 - <%=people.tel_work_ext%>
 <%end%>
<%end%>

<%if people.tel_home.to_s.size>0%>
<br/>
H:<%=people.tel_home%>
<%end%>
